#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int arr[1000];
	int n = 0;
	int  sum = 0;
	float average;
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%d", &arr[i]);
	}
	int max = arr[0];
	int min = arr[0];
	for (int i = 0; i < n; i++)
	{
		if (max < arr[i]) max = arr[i];
		if (min > arr[i])  min = arr[i];
	}
	min = 0;
	max = 0;
	for (int i = 0; i < n; i++)
	{
		sum += i;
	}
	printf("%.2f", (float)sum / (n - 2));
	return 0;

}